<?php foreach ($pages as $key => $value) : ?>
    <?php if ($value == $currentPage) : ?>
        <input type="submit"
               value="<?php echo htmlspecialchars($key); ?>"
               style="color: red"/>
        <?php else : ?>
        <input type="submit"
               value="<?php echo htmlspecialchars($key); ?>"
               onclick="javascript:html5avSetPage(<?php echo $value; ?>);"/>
    <?php endif; ?>
<?php
endforeach;